package tt.dz.order.vo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;

/**
 * @Title 系统调用的返回信息VO类
 * @author zhoutian   
 * @date 2015-12-28
 */
public class RetVO {
	/** 调用返回码，表示本次业务调用/处理是否成功：success:成功   fail:失败 */
	private String retCode;
	
	/** 业务返回码，代表了调用/处理失败的原因 */
	private String resultCode;
	
	/** 调用失败时的异常信息 */
	private String errorMsg;
	
	/** 调用/处理成功的返回数据 */
	private Object bizData;

	public String getRetCode() {
		return retCode;
	}

	public void setRetCode(String retCode) {
		this.retCode = retCode;
	}

	public String getResultCode() {
		return resultCode;
	}

	public void setResultCode(String resultCode) {
		this.resultCode = resultCode;
	}

	public String getErrorMsg() {
		return errorMsg;
	}

	public void setErrorMsg(String errorMsg) {
		this.errorMsg = errorMsg;
	}

	public Object getBizData() {
		return bizData;
	}

	public void setBizData(Object bizData) {
		this.bizData = bizData;
	}

	public RetVO() {}
	
	public RetVO(String retCode, String resultCode, String bizData) {
		this.retCode = retCode;
		if(resultCode != null) this.resultCode = resultCode;
		this.bizData = bizData;
	}
	
	public static final String SuccessCode = "success";
	
	public static final String FailCode = "fail";
	
	public String toJSONString(){
		return JSON.toJSONStringWithDateFormat(this, "yyyy-MM-dd HH:mm:ss", SerializerFeature.WriteDateUseDateFormat);
	}
}
